#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[100];
	scanf("%c-%c%c%c-%c%c%c%c%c-%c", &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7], &a[8], &a[9], &a[10]);
	int sum = 0;
	for(int i = 1;i <= 9;i++)
		sum += (a[i]-'0')*i;
	sum %= 11;
	if(sum == (a[10]-'0') || (sum == 10 && a[10] == 'X'))
		printf("Right");
	else
		printf("%c-%c%c%c-%c%c%c%c%c-%c", a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], sum == 10?'X':(sum+'0'));
    return 0;
}

